package com.wyh.mapper.appmapper;

import com.github.pagehelper.Page;
import com.wyh.domain.dto.groupfour.chargeIndexDTO.ClaimOnCreditDTO;
import com.wyh.domain.dto.groupfour.chargeIndexDTO.ClaimOnCreditPageDTO;
import com.wyh.domain.dto.groupfour.chargeIndexDTO.CustomerInfoPageDTO;

import com.wyh.domain.vo.gruopfour.chargeIndexVO.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface ChargeIndexMapper {

    //查询管理的楼盘数量
    AccountIndexVO getProjectAccountById(@Param("id") Integer id);

    //查询业主和租户的数量
    AccountIndexVO getOwnerAndTenantAccountById(@Param("allResourceIds") List<Integer> allResourceIds);

    //查询代收金额
    DoTaskIndexVO getPendingMonenyById(@Param("allCustomerIds") List<Integer> allCustomerIds);

    //代退款数量
    DoTaskIndexVO getRefundById(@Param("allCustomerIds") List<Integer> allCustomerIds) ;

    //查询代认领金额数量
    DoTaskIndexVO getUnclaimedPaymentsCount(@Param("allCustomerIds") List<Integer> allCustomerIds);

    //查管理员所有的组织名称
    OrganizationNamesVO getUserWithOrganizationNames(Integer id);

    //已超数量
    int countReadySumByReadingTime(@Param("allResourceIds") List<Integer> allResourceIds1,@Param("readingTime") java.sql.Date readingTime);

    //需超数量
    Integer countSumByReadingTime(@Param("userid") Integer userid,@Param("time") LocalDateTime readingTime);

    //挂账认领
    Page<ClaimOnCreditVO> getPaymentRecordsByCustomerIds(@Param("allResourceIds") List<Integer> allCustomerIds,
                                                           ClaimOnCreditPageDTO claimOnCreditPage);

    //点击认领查看单个认领信息
    ClaimOnCreditVO getSingleClaiming(@Param("id") Integer id);

    //根据用户名称和客户电话查询查询用户信息
    Page<CustomerNameVO> findCustomersByNameAndTelephone(
            @Param("allResourceIds") List<Integer> allResourceIds,
            @Param("customerInfoPage") CustomerInfoPageDTO customerInfoPage,
            @Param("customerName") String customerName,
            @Param("telephone") String telephone);

    //点解认领
    int updatePaymentrecords(ClaimOnCreditDTO claimOnCreditDTO);


    // 获取用户id,查代认领
    List<Integer> getDistinctCustomerIds(@Param("allResourceIds") List<Integer> allResourceIds);


    CustomerNameVO getSingleCustomerInfo(Integer id);


}

